<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>'1234567898765432123456789...'的第n位是什么</title>
</head>
<body>
  <script>
    // '1234567898765432123456789...'的第n位是什么
    function getNum(n) {
      //'1234567898765432123456789...'的最小循环节是'1234567898765432'，长度为16
      let minStr = '1234567898765432'
      let x = n % minStr.length //求余数
      if(x > 0) {
        return minStr.charAt(x-1)
      } else {
        return minStr.charAt(minStr.length - 1)
      }
    }
    console.log('getNum(16)', getNum(16));
  </script>
</body>
</html>